Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

find-node-modules

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-node-modules

Return an array of all parent node_modules directories

  • 2.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1M
decreased by-11.16%
Maintainers
1
Weekly downloads
 
Created

What is find-node-modules?

The find-node-modules npm package is a utility that helps you locate the node_modules directories in your project. This can be particularly useful in monorepos or projects with complex directory structures where node_modules might not be in the root directory.

What are find-node-modules's main functionalities?

Find node_modules in the current directory

This feature allows you to find all node_modules directories starting from the current directory. The code sample demonstrates how to use the package to get an array of paths to node_modules directories.

const findNodeModules = require('find-node-modules');
const paths = findNodeModules();
console.log(paths);

Find node_modules in a specific directory

This feature allows you to specify a starting directory to search for node_modules directories. The code sample shows how to find node_modules directories starting from a given path.

const findNodeModules = require('find-node-modules');
const paths = findNodeModules('/path/to/start');
console.log(paths);

Find node_modules with custom options

This feature allows you to customize the search with options such as the starting directory (cwd) and whether to return relative paths. The code sample demonstrates how to use these options.

const findNodeModules = require('find-node-modules');
const paths = findNodeModules({ cwd: '/path/to/start', relative: false });
console.log(paths);

Other packages similar to find-node-modules

FAQs

Package last updated on 01 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc